<!DOCTYPE html>
<html lang="zh" xmlns:th="https://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
    <title>微笑计划管理后台 </title>
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700" rel="stylesheet">
    <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/plugins.css" rel="stylesheet" type="text/css" />
    <!-- END GLOBAL MANDATORY STYLES -->

    <!-- BEGIN PAGE LEVEL CUSTOM STYLES -->
    <link rel="stylesheet" type="text/css" href="/plugins/table/datatable/datatables.css">
    <link rel="stylesheet" type="text/css" href="/plugins/table/datatable/custom_dt_html5.css">
    <link rel="stylesheet" type="text/css" href="/plugins/table/datatable/dt-global_style.css">
    <link th:href="@{/plugins/notification/snackbar/snackbar.min.css}" rel="stylesheet" type="text/css" />
    <!-- END PAGE LEVEL CUSTOM STYLES -->

	<!-- BEGIN PAGE LEVEL STYLES -->
	<link href="/assets/css/scrollspyNav.css" rel="stylesheet" type="text/css" />
	<link href="/plugins/file-upload/file-upload-with-preview.min.css" rel="stylesheet" type="text/css" />
	<!-- END PAGE LEVEL STYLES -->

	<!--  BEGIN CUSTOM STYLE FILE  -->
	<link rel="stylesheet" type="text/css" href="/plugins/editors/quill/quill.snow.css">


	<!-- Font Awesome -->
	<link href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
	<!-- Ionicons -->
	<link href="https://cdn.staticfile.org/ionicons/4.1.2/css/ionicons.min.css" rel="stylesheet">

	<link href="https://cdn.staticfile.org/codemirror/5.38.0/codemirror.min.css" rel="stylesheet">
	<!--富文本编辑器wangEditor-->
	<!-- jQuery -->
	<script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
	<!-- Bootstrap -->
	<script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.1/js/bootstrap.min.js"></script>
	<!-- FastClick -->
	<script src="https://cdn.staticfile.org/fastclick/1.0.6/fastclick.min.js"></script>
	<script src="https://cdn.staticfile.org/jQuery-slimScroll/1.3.8/jquery.slimscroll.min.js"></script>
	<script src="https://cdn.staticfile.org/layer/2.3/layer.js"></script>
	<script src="https://cdn.staticfile.org/codemirror/5.38.0/codemirror.min.js"></script>
	<script src="https://cdn.staticfile.org/codemirror/5.38.0/addon/display/placeholder.min.js"></script>
	<script src="https://cdn.staticfile.org/codemirror/5.38.0/mode/clike/clike.min.js"></script>
	<script src="https://cdn.staticfile.org/codemirror/5.38.0/mode/sql/sql.min.js"></script>
	<script src="https://cdn.staticfile.org/codemirror/5.38.0/mode/xml/xml.min.js"></script>



	<!--  END CUSTOM STYLE FILE  -->
</head>
<style>
	img{
		width: auto;
		height: 50px;
	}
</style>
<body class="sidebar-noneoverflow">

    <!--  BEGIN NAVBAR  -->
    <div class="header-container fixed-top">
        <header class="header navbar navbar-expand-sm">
            <a href="javascript:void(0);" class="sidebarCollapse" data-placement="bottom"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></a>
            <ul class="navbar-item flex-row">
            </ul>
            <ul class="navbar-item flex-row search-ul">
            </ul>
            <ul class="navbar-item flex-row navbar-dropdown">
                <li class="nav-item dropdown user-profile-dropdown  order-lg-0 order-1">
                    <a href="javascript:void(0);" class="nav-link dropdown-toggle user" id="userProfileDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>
                    </a>
                    <div class="dropdown-menu position-absolute" aria-labelledby="userProfileDropdown">
                        <div class="">
                            <div class="dropdown-item">
                                <a class="" href="/admin/userinfo"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>个人资料</a>
                            </div>
                            <div class="dropdown-item">
                                <a class="" href="/addmin/out"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg>退出登录</a>
                            </div>
                        </div>
                    </div>
                </li>
            </ul>
        </header>
    </div>
    <!--  END NAVBAR  -->

    <!--  BEGIN MAIN CONTAINER  -->
    <div class="main-container" id="container">

        <div class="overlay"></div>
        <div class="cs-overlay"></div>
        <div class="search-overlay"></div>

        <!--  BEGIN SIDEBAR  -->
        <div class="sidebar-wrapper sidebar-theme">

            <nav id="sidebar">

               <ul class="navbar-nav theme-brand flex-row  text-center">

                   <li class="nav-item theme-text">
                       <a href="/admin" class="nav-link"> 微笑计划 </a>
                   </li>
                   <li class="nav-item toggle-sidebar">
                       <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left sidebarCollapse"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>
                   </li>
               </ul>

                <div class="shadow-bottom"></div>


                <ul class="list-unstyled menu-categories" id="accordionExample">

					<li class="menu">
					    <a href="#dashboard" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle collapsed">
					        <div class="">
					            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
					            <span>仪表盘</span>
					        </div>
					        <div>
					            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
					        </div>
					    </a>
					    <ul class="submenu recent-submenu mini-recent-submenu list-unstyled collapse" id="dashboard" data-parent="#accordionExample">
					        <li class="active">
					            <a href="/admin"> 数据统计 </a>
					        </li>
					    </ul>
					</li>

					<li class="menu ">
					    <a href="#userMager" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle collapsed">
					        <div class="">
					            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>
                                    <span>会员</span><span>会员</span>
					        </div>
					        <div>
					            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
					        </div>
					    </a>
						<ul class="submenu recent-submenu mini-recent-submenu list-unstyled collapse" id="userMager" data-parent="#accordionExample">
							<li class="active">
								<a href="/admin/userList"> 会员列表 </a>
							</li>
							<li class="">
								<a href="/admin/userListAngel"> 天使列表 </a>
							</li>
							<li class="">
								<a href="/admin/userListCity"> 市代列表 </a>
							</li>
							<li class="">
								<a href="/admin/userListProvince"> 省代列表 </a>
							</li>
							<li class="">
								<a href="/admin/userListPartner"> 分公司列表 </a>
							</li>
						</ul>
					</li>





					<li class="menu">
					    <a href="#shopMager" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle collapse">
					        <div class="">
					            <svg t="1616857683050" class="icon" viewBox="0 0 1170 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3316" width="108" height="108"><path d="M103.619 387.95c1.658 107.617 43.057 155.16 129.95 155.16 94.404 0 145.457-28.282 161.597-83.87l25.942-89.527 29.842 88.259c19.505 57.539 62.123 85.138 134.632 85.138 72.996 0 118.004-28.087 140.922-86.455l22.43-57.051 30.232 53.345c53.151 93.672 115.42 122.051 194.707 92.063 78.458-29.647 107.276-89.332 88.259-188.855l-139.8-259.755H251.513L103.619 387.998z m129.95 213.674c-123.66 0-188.562-77.921-188.562-220.55v-7.07l155.16-305.737a55.442 55.442 0 0 1 49.494-30.379h674.572c20.383 0 39.107 11.215 48.762 29.16l142.775 265.264 2.926 8.095c25.99 128.634-16.043 218.502-124.1 259.364-93.964 35.5-175.201 8.875-238.494-75.337-36.815 51.103-94.598 77.19-170.472 77.19-72.411 0-127.414-23.893-162.182-70.558-37.059 47.153-101.522 70.558-189.83 70.558z m-115.224 83.773a29.257 29.257 0 1 1 58.514 0v228.304c0 12.678 10.338 23.064 23.114 23.064h754.736a23.064 23.064 0 0 0 23.065-23.064V685.397a29.257 29.257 0 1 1 58.514 0v228.304c0 45.056-36.523 81.578-81.579 81.578H199.973c-45.105 0-81.628-36.571-81.628-81.578V685.397z" p-id="3317" fill="#888ea8"></path><path d="M243.76 358.205a29.257 29.257 0 1 1 0-58.514h669.16a29.257 29.257 0 1 1 0 58.514H243.76z" p-id="3318" fill="#888ea8"></path></svg>
					            <span>商城</span>
					        </div>
					        <div>
					            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
					        </div>
					    </a>
					    <ul class="submenu recent-submenu mini-recent-submenu list-unstyled collapse" id="shopMager" data-parent="#accordionExample">
							<li class="">
								<a href="/admin/shopGoodsMenu"> 商品分类 </a>
							</li>
							<li class="">
					            <a href="/admin/shopGoodsList"> 商品管理 </a>
					        </li>
							<li class="">
							    <a href="/admin/shopOrderList?type=3"> 订单管理（全部） </a>
							</li>
							<li class="">
								<a href="/admin/shopOrderList?type=0"> 待发货 </a>
							</li>
							<li class="">
								<a href="/admin/shopOrderList?type=1"> 待收货 </a>
							</li>
							<li class="">
								<a href="/admin/shopOrderList?type=2"> 已完成 </a>
							</li>
					    </ul>
					</li>


					<li class="menu">
					    <a href="#uniappMager" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle collapsed">
					        <div class="">
					            <svg t="1616857400944" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2079" width="108" height="108"><path d="M512 64c247.424 0 448 200.576 448 448S759.424 960 512 960 64 759.424 64 512 264.576 64 512 64z m0 64c-212.077 0-384 171.923-384 384s171.923 384 384 384 384-171.923 384-384-171.923-384-384-384z m104.284 141.363c74.637 0 135.363 60.726 135.363 135.363 0 52.558-30.834 100.8-78.545 122.887a31.842 31.842 0 0 1-13.405 2.966 31.958 31.958 0 0 1-29.026-18.542c-7.341-15.858-0.58-34.636 15.099-42.206l0.477-0.226c25.2-11.665 41.477-37.128 41.477-64.88 0-39.394-32.045-71.439-71.44-71.439-39 0-70.798 31.408-71.43 70.26l-0.01 1.18c0 0.879-0.043 1.792-0.128 2.78l-0.01 0.214V618.04h-0.362v2.5c0 74.638-60.726 135.363-135.362 135.363-74.637 0-135.363-60.725-135.363-135.362 0-52.586 30.856-100.838 78.601-122.915 16.02-7.41 35.015-0.427 42.425 15.596 7.335 15.862 0.565 34.637-15.118 42.2l-0.478 0.225c-25.217 11.66-41.507 37.127-41.507 64.894 0 39.394 32.045 71.439 71.44 71.439 39.394 0 71.439-32.045 71.439-71.44 0-1.603 0.12-3.205 0.358-4.791l0.028-0.185-0.001-208.338h0.116v-2.5c0-73.89 59.516-134.146 133.127-135.344l2.235-0.018z" p-id="2080" fill="#888ea8"></path></svg>
					            <span>小程序</span>
					        </div>
					        <div>
					            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
					        </div>
					    </a>
					    <ul class="submenu recent-submenu mini-recent-submenu list-unstyled collapse" id="uniappMager" data-parent="#accordionExample">
					        <li class="">
					            <a href="/admin/uniIndex"> 首页排版 </a>
					        </li>
							<li class="">
					            <a href="/admin/uniSwiper"> 首页轮播 </a>
					        </li>
							<li class="">
							    <a href="/admin/uniHome"> 微笑计划排版 </a>
							</li>
					    </ul>
					</li>


					<li class="menu active">
					    <a href="#articleMager" data-toggle="collapse" aria-expanded="true" class="dropdown-toggle ">
					        <div class="">
					            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
					            <span>文章管理</span>
					        </div>
					        <div>
					            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
					        </div>
					    </a>
					    <ul class="collapse submenu recent-submenu mini-recent-submenu list-unstyled show" id="articleMager" data-parent="#accordionExample">
					        <li class="active">
								<a href="/admin/articleList"> 文章列表 </a>
					        </li>
						</ul>
					</li>

					<li class="menu">
					    <a href="#moneyMager" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle collapsed">
					        <div class="">
					            <svg t="1616857765295" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4246" width="108" height="108"><path d="M639.414168 336.899827H588.780264a16.618153 16.618153 0 0 0-14.739492 8.733774L511.795146 463.669454l-62.235633-118.035853a16.618153 16.618153 0 0 0-14.739492-8.733774h-50.643897a7.994301 7.994301 0 0 0-7.374742 11.621715l73.947284 140.270003h-50.873733a15.988602 15.988602 0 0 0-15.988602 15.988602v23.982903a15.988602 15.988602 0 0 0 15.988602 15.988602h79.943009v47.965805h-79.943009a15.988602 15.988602 0 0 0-15.988602 15.988602v23.982903a15.988602 15.988602 0 0 0 15.988602 15.988602h79.943009v63.954407a15.988602 15.988602 0 0 0 15.988602 15.988602h31.977204a15.988602 15.988602 0 0 0 15.988602-15.988602v-63.954407h79.943009a15.988602 15.988602 0 0 0 15.988602-15.988602v-23.982903a15.988602 15.988602 0 0 0-15.988602-15.988602h-79.943009v-47.965805h79.943009a15.988602 15.988602 0 0 0 15.988602-15.988602v-23.982903a15.988602 15.988602 0 0 0-15.988602-15.988602h-50.883725l73.947283-140.270003a7.994301 7.994301 0 0 0-7.364749-11.621715z" p-id="4247" fill="#888ea8"></path><path d="M511.405424 113.059401c-220.752628 0-399.715047 178.962419-399.715047 399.715047s178.962419 399.715047 399.715047 399.715047 399.715047-178.962419 399.715047-399.715047-178.962419-399.715047-399.715047-399.715047zM754.462151 755.851161A342.505831 342.505831 0 1 1 828.169606 646.539088 342.67571 342.67571 0 0 1 754.462151 755.851161z" p-id="4248" fill="#888ea8"></path></svg>
					            <span>资金记录</span>
					        </div>
					        <div>
					            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
					        </div>
					    </a>
					    <ul class="submenu recent-submenu mini-recent-submenu list-unstyled collapse" id="moneyMager" data-parent="#accordionExample">
							<li class="">
								<a href="/admin/shopCzList"> 充值记录 </a>
							</li>
							<li class="">
								<a href="/admin/shopSyList"> 收益记录 </a>
							</li>
						</ul>
					</li>

                </ul>
            </nav>

        </div>
        <!--  END SIDEBAR  -->

        <!--  BEGIN CONTENT AREA  -->
        <div id="content" class="main-content">

            <div class="layout-px-spacing">

                <div class="row layout-top-spacing" id="cancel-row">

                    <div class="col-xl-12 col-lg-12 col-sm-12  layout-spacing">
                        <div class="widget-content widget-content-area br-6">
							<button class="btn btn-primary mb-2" onclick="window.history.back();">返回</button>

								<div class="input-group mb-4 col-xl-6 col-lg-6 col-sm-6">
									<div class="input-group-prepend">
										<span class="input-group-text" id="basic-addon5">文章标题</span>
									</div>
									<input type="text" class="form-control" name="title" placeholder="文章标题" aria-label="文章标题">
								</div>
								<div class="row">
									<div class="col-xl-12 col-md-12 col-sm-12 col-12">
										<h4> 文章缩略图 </h4>
									</div>
								</div>

								<div class="input-group mb-4 col-xl-10 col-lg-10 col-sm-10" style="margin:10px">
									<div id="imgSelect" style="width:100%">
										<input type="file" id="img" accept="image/*">
										<button onclick="uploadImg('img')">上传</button>
									</div>
									<div id="imgShowDiv" style="display:inline-grid;display:none">
										<div id="imgShow" style="width:100%">
										</div>
										<div style="text-align: center">
											<a onclick="delImg('img')">删除</a>
										</div>
									</div>
								</div>

								<div class="widget-header">
									<div class="row">
										<div class="col-xl-12 col-md-12 col-sm-12 col-12">
											<h4> 文章内容 </h4>
										</div>
									</div>
								</div>
								<div>
									<div id="content1" style="width:100%;">


									</div>
								</div>

								<button class="btn btn-primary mb-2" onclick="add()">保存</button>
							<!--</form>-->
                        </div>
                    </div>

                </div>

			</div>
        	<div class="footer-wrapper">
                <div class="footer-section f-section-1">
                    <p class="">Copyright © 2021 郑州灵之动网络科技有限公司</p>
                </div>

            </div>
        </div>
        <!--  END CONTENT AREA  -->

    </div>
    <!-- END MAIN CONTAINER -->



    <!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
    <script th:src="@{/plugins/notification/snackbar/snackbar.min.js}"></script>
    <script src="/assets/js/libs/jquery-3.1.1.min.js"></script>
    <script src="/bootstrap/js/popper.min.js"></script>
    <script src="/bootstrap/js/bootstrap.min.js"></script>
    <script src="/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
    <script src="/assets/js/app.js"></script>
	<script src="/plugins/file-upload/file-upload-with-preview.min.js"></script>
	<script src="/plugins/editors/quill/quill.js"></script>


	<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.min.js"> </script>
	<script type="text/javascript" charset="utf-8" src="/ueditor/lang/zh-cn/zh-cn.js"></script>

	<script>

		var ue = UE.getEditor('content1');

		UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
		UE.Editor.prototype.getActionUrl = function(action) {
			if (action == 'uploadimage'){
				return '/uploadimage'; /* 你自己的图片上传action */
			}else{
				return this._bkGetActionUrl.call(this, action);
			}
		};



		function uploadImg(imgItem) {
			var formdata=new FormData();
			var img = $('#' + imgItem).get(0).files[0];
			if (!img) {
				Snackbar.show({
					text: "请选择图片",
					pos: 'top-center'
				});
				return false;
			}
			formdata.append('img', img);
			$.ajax({
				async: false,
				type: 'POST',
				url: "/admin/uploadImg",
				dataType: 'json',
				data: formdata,
				contentType:false,//ajax上传图片需要添加
				processData:false,//ajax上传图片需要添加
				success: function (data) {
					if(data.code == "200"){
						$("#" + imgItem + "ShowDiv").show();
						$("#" + imgItem + "Show").html("<img name='image' src='"+data.data+"' style='height:100px'/>");
						$("#" + imgItem + "Select").hide();
						$('#' + imgItem).val("");
					}
					else {
						$("#imgShow").html("上传失败");
					}
				},
				error: function (e) {
					alert("error");
				}
			})
		}
		function delImg(imgItem) {
			$("#" + imgItem + "ShowDiv").hide();
			$("#" + imgItem + "Select").show();
		}

		function add() {
			$("input[name='content1']").val(UE.getEditor('content1').getContent());
			var title = $("input[name='title']").val();
			if (!title) {
				Snackbar.show({
					text: "请输入文章标题",
					pos: 'top-center'
				});
				return false;
			}
			var image = $("img[name='image']").attr("src");
			if (!image) {
				Snackbar.show({
					text: "请上传文章缩略图",
					pos: 'top-center'
				});
				return false;
			}
			var content = UE.getEditor('content1').getContent()
			if (!content) {
				Snackbar.show({
					text: "请输入文章内容",
					pos: 'top-center'
				});
				return false;
			}
			$.ajax({
				url: "/admin/addArticle",
				method: "POST",
				data: {title:title,image:image,content:content},
				dataType:"json",
				async: false,
				success: function (result) {
					if(result.code == "500"){
						Snackbar.show({
							text: result.msg,
							pos: 'top-center'
						});
						setTimeout(function (){
							window.location.reload();
						}, 1500);
					}else if(result.code == "200"){
						Snackbar.show({
							text: result.msg,
							pos: 'top-center'
						});
						setTimeout(function (){
							window.location.href="/admin/articleList";
						}, 1500);
					}else if(result.code == "100"){
						Snackbar.show({
							text: "您已掉线！",
							pos: 'top-center'
						});
						setTimeout(function (){
							window.location.href="/admin/login";
						}, 1500);
					}
				},
				error : function() {
					Snackbar.show({
						text: '请稍后再试',
						pos: 'top-center'
					});
					setTimeout(function (){
						window.location.reload();
					}, 1500);
				}
			})
		}
	</script>

    <script src="/assets/js/custom.js"></script>
    <!-- END GLOBAL MANDATORY SCRIPTS -->

    <!-- BEGIN PAGE LEVEL CUSTOM SCRIPTS -->
    <script src="/plugins/table/datatable/datatables.js"></script>
    <!-- NOTE TO Use Copy CSV Excel PDF Print Options You Must Include These Files  -->
    <script src="/plugins/table/datatable/button-ext/dataTables.buttons.min.js"></script>
    <script src="/plugins/table/datatable/button-ext/jszip.min.js"></script>
    <script src="/plugins/table/datatable/button-ext/buttons.html5.min.js"></script>
    <script src="/plugins/table/datatable/button-ext/buttons.print.min.js"></script>


    <!-- END PAGE LEVEL CUSTOM SCRIPTS -->
</body>
</html>
